package net.maku.module.asset.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.AllArgsConstructor;
import net.maku.module.asset.dao.AssetStorageDao;
import net.maku.module.asset.entity.AssetStorageEntity;
import net.maku.module.asset.service.AssetStorageService;
import net.maku.newbase.NewBaseServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 业务_资产仓库
 *
 * @author
 */
@Service
@AllArgsConstructor
public class AssetStorageServiceImpl extends NewBaseServiceImpl<AssetStorageDao, AssetStorageEntity> implements AssetStorageService {

    @Override
    public boolean updateIsEnableById(AssetStorageEntity entity) {
        LambdaUpdateWrapper<AssetStorageEntity> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(AssetStorageEntity::getId, entity.getId())
                .set(AssetStorageEntity::getIsEnable, entity.getIsEnable());

        return this.update(updateWrapper);
    }
}